<%--
  Created by IntelliJ IDEA.
  User: Lili_Could
  Date: 2025/9/27
  Time: 下午7:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>学生成绩管理系统 - 管理员主页</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" href="${pageContext.request.contextPath}/static/admin-title.svg">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/page/admin/css/common.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/page/admin/css/student.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/page/admin/css/teacher.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/page/admin/css/college.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/page/admin/css/major.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/page/admin/css/class.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/page/admin/css/course.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/page/admin/css/schedule.css">

</head>
<body>
<div class="container">
    <!-- 侧边栏 -->
    <div class="sidebar" id="sidebar">
        <div class="logo">
            <h2>
                <span class="menu-icon">📊</span>
                <span class="logo-text">成绩管理系统</span>
            </h2>
        </div>
        <button class="toggle-btn" onclick="toggleSidebar()">
            <i class="fas fa-chevron-left"></i>
        </button>
        <ul id="menuList">
            <!-- 菜单项将通过JavaScript动态生成 -->
        </ul>
    </div>

    <!-- 主内容区域 -->
    <div class="main-content" id="mainContent">
        <!-- 错误信息模态框 -->
        <div class="error-modal" id="errorModal">
            <div class="modal-content">
                <button class="close-btn" onclick="closeErrorModal()">&times;</button>
                <h2 class="modal-title">错误</h2>
                <p class="error-message" id="errorMessage"></p>
            </div>
        </div>

        <!-- 头部 -->
        <div class="header">
            <h1>管理员控制台</h1>
            <div class="user-info">
                <span>欢迎，管理员${sessionScope.userName}</span>
                <button class="logout-btn" onclick="logout()">退出登录</button>
            </div>
        </div>

        <!-- 内容区域 -->
        <div class="content">

            <!-- 首页内容 -->
            <div id="home-content" class="content-section active">
                <h1 class="page-title">仪表板</h1>
                <div class="welcome-card">
                    <h2>欢迎使用学生成绩管理系统</h2>
                    <p>作为系统管理员，您可以管理学生信息、教师信息、课程安排等核心功能。请使用左侧导航菜单访问各个管理模块。</p>
                </div>
                <div class="cards-grid">
                    <div class="card" onclick="switchContent('student')">
                        <div class="card-icon" style="background: rgba(52, 152, 219, 0.1); color: #3498db;">
                            <i class="fas fa-users"></i>
                        </div>
                        <h3>学生管理</h3>
                        <p>管理学生基本信息</p>
                    </div>
                    <div class="card" onclick="switchContent('teacher')">
                        <div class="card-icon" style="background: rgba(46, 204, 113, 0.1); color: #2ecc71;">
                            <i class="fas fa-chalkboard-teacher"></i>
                        </div>
                        <h3>教师管理</h3>
                        <p>管理教师信息、职称、所属学院等</p>
                    </div>
                    <div class="card" onclick="switchContent('course')">
                        <div class="card-icon" style="background: rgba(155, 89, 182, 0.1); color: #9b59b6;">
                            <i class="fas fa-book"></i>
                        </div>
                        <h3>课程管理</h3>
                        <p>管理课程信息、学分、开课学院等</p>
                    </div>
                    <div class="card" onclick="switchContent('class')">
                        <div class="card-icon" style="background: rgba(230, 126, 34, 0.1); color: #e67e22;">
                            <i class="fas fa-school"></i>
                        </div>
                        <h3>班级管理</h3>
                        <p>管理班级信息</p>
                    </div>
                    <div class="card" onclick="switchContent('college')">
                        <div class="card-icon" style="background: rgba(231, 76, 60, 0.1); color: #e74c3c;">
                            <i class="fas fa-building"></i>
                        </div>
                        <h3>学院管理</h3>
                        <p>管理学院信息</p>
                    </div>
                    <div class="card" onclick="switchContent('major')">
                        <div class="card-icon" style="background: rgba(155, 89, 182, 0.1); color: #9b59b6;">
                            <i class="fas fa-graduation-cap"></i>
                        </div>
                        <h3>专业管理</h3>
                        <p>管理专业信息、所属学院等</p>
                    </div>
                    <div class="card" onclick="switchContent('schedule')">
                        <div class="card-icon" style="background: rgba(46, 204, 113, 0.1); color: #2ecc71;">
                            <i class="fas fa-calendar-alt"></i>
                        </div>
                        <h3>课程安排</h3>
                        <p>管理课程时间安排、授课教师等</p>
                    </div>
                </div>
            </div>

            <!-- 学生管理内容 -->
            <div id="student-content" class="content-section">
                <!-- 加载界面 -->
                <div class="loading-box" v-show="loading">
                    <div class="spinner"></div>
                    <p class="loading-text">正在加载...</p>
                </div>

                <!-- 添加学生模态框表单页面 -->
                <div class="studentAddModal" id="studentAddModal">
                    <div class="modal-content">
                        <button class="close-btn" onclick="closeStudentAddModal()">&times;</button>
                        <form @submit.prevent="addStudent">
                            <h2 class="modal-title">添加学生信息</h2>
                            <label for="userNo">学号 (10位)</label>
                            <input type="text" id="userNo" v-model="formData.userNo" @input="extractInfoFromUserNo" required maxlength="10">
                            <label for="name">姓名</label>
                            <input type="text" id="name" v-model="formData.name" required>
                            <label for="enrollmentYear">入学年份</label>
                            <input type="text" id="enrollmentYear" v-model="formData.enrollmentYear" readonly>
                            <label for="collegeCode">学院代码</label>
                            <input type="text" id="collegeCode" v-model="formData.collegeCode" readonly>
                            <label for="majorCode">专业代码</label>
                            <input type="text" id="majorCode" v-model="formData.majorCode" readonly>
                            <label for="classCode">班级代码</label>
                            <input type="text" id="classCode" v-model="formData.classCode" readonly>
                            <button type="submit">添加学生</button>

                        </form>
                    </div>
                </div>

                <h1 class="page-title">学生管理</h1>
                <div class="management-content active">
                    <div class="management-header">
                        <h2>学生列表</h2>
                        <!-- 顶部按钮 -->
                        <div class="opt-btn-group">
                            <button class="opt-btn refresh-btn" @click="loadStudents">
                                <i class="fas fa-refresh"></i> 刷新
                            </button>
                            <button class="opt-btn add-btn" onclick="showStudentAddModal()">
                                <i class="fas fa-plus"></i> 添加学生
                            </button>
                        </div>

                    </div>
                    <div class="table-container">
                        <table>
                            <thead>
                                <tr>
                                    <th>学号</th>
                                    <th>姓名</th>
                                    <th>入学年份</th>
                                    <th>学院</th>
                                    <th>专业</th>
                                    <th>班级</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            <tr v-for="student in students">
                                <td>{{ student.userNo }}</td>
                                <td>{{ student.name }}</td>
                                <td>20{{ student.enrollmentYear }}</td>
                                <td>{{ student.collegeName }}</td>
                                <td>{{ student.majorName }}</td>
                                <td>{{ student.className }}</td>
                                <td>
                                    <button class="action-btn edit-btn" @click="updateStudent">
                                        <i class="fas fa-edit"></i> 编辑
                                    </button>
                                    <button class="action-btn delete-btn" @click="deleteStudent(student.userNo)">
                                        <i class="fas fa-trash"></i> 删除
                                    </button>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>

            <!-- 教师管理内容 -->
            <div id="teacher-content" class="content-section">

                <!-- 加载界面 -->
                <div class="loading-box" v-show="loading">
                    <div class="spinner"></div>
                    <p class="loading-text">正在加载...</p>
                </div>

                <!-- 添加教师模态框表单页面 -->
                <div class="teacherAddModal" id="teacherAddModal">
                    <div class="modal-content">
                        <button class="close-btn" onclick="closeTeacherAddModal()">&times;</button>
                        <form @submit.prevent="addTeacher">
                            <h2 class="modal-title">添加教师信息</h2>
                            <label for="userNo-teacher">工号 (10位)</label>
                            <input type="text" id="userNo-teacher" v-model="formData.userNo" @input="extractInfoFromUserNo" required maxlength="10">
                            <label for="name-teacher">姓名</label>
                            <input type="text" id="name-teacher" v-model="formData.name" required>
                            <label for="title">职称</label>
                            <input type="text" id="title" v-model="formData.title" required>
                            <label for="hireYear">入职年份</label>
                            <input type="text" id="hireYear" v-model="formData.hireYear" readonly>
                            <label for="collegeCode-teacher">学院代码</label>
                            <input type="text" id="collegeCode-teacher" v-model="formData.collegeCode" readonly>
                            <button type="submit">添加教师</button>
                        </form>
                    </div>
                </div>

                <h1 class="page-title">教师管理</h1>
                <div class="management-content active">
                    <div class="management-header">
                        <h2>教师列表</h2>
                            <div class="opt-btn-group">
                                <button class="opt-btn refresh-btn" @click="loadTeachers">
                                    <i class="fas fa-refresh"></i> 刷新
                                </button>
                                <button class="opt-btn add-btn" onclick="showTeacherAddModal()">
                                    <i class="fas fa-plus"></i> 添加老师
                                </button>
                            </div>
                    </div>
                    <div class="table-container">
                        <table>
                            <thead>
                                <tr>
                                    <th>工号</th>
                                    <th>姓名</th>
                                    <th>学院</th>
                                    <th>职称</th>
                                    <th>入职年份</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr v-for="teacher in teachers">
                                    <td>{{ teacher.userNo }}</td>
                                    <td>{{ teacher.name }}</td>
                                    <td>{{ teacher.collegeName }}</td>
                                    <td>{{ teacher.title }}</td>
                                    <td>20{{ teacher.hireYear }}</td>
                                    <td>
                                        <button class="action-btn edit-btn" @click="updateTeacher">编辑</button>
                                        <button class="action-btn delete-btn" @click="deleteTeacher(teacher.userNo)">删除</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>

            <!-- 课程管理内容 -->
            <div id="course-content" class="content-section">

                <!-- 加载界面 -->
                <div class="loading-box" v-show="loading">
                    <div class="spinner"></div>
                    <p class="loading-text">正在加载...</p>
                </div>

                <!-- 添加课程模态框表单页面 -->
                <div class="courseAddModal" id="courseAddModal">
                    <div class="modal-content">
                        <button class="close-btn" onclick="closeCourseAddModal()">&times;</button>
                        <form @submit.prevent="addCourse">
                            <h2 class="modal-title">添加课程信息</h2>
                            <label for="courseCode-course">课程编号</label>
                            <input type="text" id="courseCode-course" v-model="formData.courseCode" required>
                            <label for="courseName-course">课程名称</label>
                            <input type="text" id="courseName-course" v-model="formData.courseName" required>
                            <label for="credit">学分</label>
                            <input type="number" id="credit" v-model="formData.credit" step="0.1" min="0" required>
                            <label for="collegeCode-course">开课学院</label>
                            <select id="collegeCode-course" class="college-select" v-model="formData.collegeCode" required>
                                <option value="">请选择开课学院</option>
                                <option v-for="college in colleges" :value="college.collegeCode">{{ college.collegeName }}</option>
                            </select>
                            <button type="submit">添加课程</button>
                        </form>
                    </div>
                </div>

                <h1 class="page-title">课程管理</h1>
                <div class="management-content active">
                    <div class="management-header">
                        <h2>课程列表</h2>
                        <div class="opt-btn-group">
                            <button class="opt-btn refresh-btn" @click="loadCourses">
                                <i class="fas fa-refresh"></i> 刷新
                            </button>
                            <button class="opt-btn add-btn" onclick="showCourseAddModal()">
                                <i class="fas fa-plus"></i> 添加课程
                            </button>
                        </div>
                    </div>
                    <div class="table-container">
                        <table>
                            <thead>
                                <tr>
                                    <th>课程编号</th>
                                    <th>课程名称</th>
                                    <th>学分</th>
                                    <th>开课学院</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr v-for="course in courses">
                                    <td>{{ course.courseCode }}</td>
                                    <td>{{ course.courseName }}</td>
                                    <td>{{ course.credit }}</td>
                                    <td>{{ getCollegeNameByCode(course.collegeCode) }}</td>
                                    <td>
                                        <button class="action-btn edit-btn" @click="updateCourse">编辑</button>
                                        <button class="action-btn delete-btn" @click="deleteCourse(course.courseId)">删除</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>

            <!-- 班级管理内容 -->
            <div id="class-content" class="content-section">

                <!-- 加载界面 -->
                <div class="loading-box" v-show="loading">
                    <div class="spinner"></div>
                    <p class="loading-text">正在加载...</p>
                </div>

                <!-- 添加班级模态框表单页面 -->
                <div class="classAddModal" id="classAddModal">
                    <div class="modal-content">
                        <button class="close-btn" onclick="closeClassAddModal()">&times;</button>
                        <form @submit.prevent="addClass">
                            <h2 class="modal-title">添加班级信息</h2>
                            <label for="classCode-class">班级代码</label>
                            <input type="text" id="classCode-class" v-model="formData.classCode" required>
                            <label for="className-class">班级名称</label>
                            <input type="text" id="className-class" v-model="formData.className" required>
                            <label for="enrollmentYear-class">所属年份</label>
                            <input type="text" id="enrollmentYear-class" v-model="formData.enrollmentYear" required>
                            <!-- 修改 添加学院模态框表单页面 中的专业选择部分 -->
                            <label for="majorCode-class">所属专业</label>
                            <select id="majorCode-class" class="major-select" v-model="formData.majorCode" @change="updateCollegeCode" required>
                                <option value="">请选择专业</option>
                                <option v-for="major in majors" :value="major.majorCode" :data-college-code="major.collegeCode">
                                    {{ major.majorName }}
                                </option>
                            </select>
                            <!-- 根据专业自动获取学院代码 -->
                            <input type="hidden" id="collegeCode-class" v-model="formData.collegeCode" required>
                            <button type="submit">添加班级</button>
                        </form>
                    </div>
                </div>

                <h1 class="page-title">班级管理</h1>
                <div class="management-content active">
                    <div class="management-header">
                        <h2>班级列表</h2>
                        <div class="opt-btn-group">
                            <button class="opt-btn refresh-btn" @click="loadClasses">
                                <i class="fas fa-refresh"></i> 刷新
                            </button>
                            <button class="opt-btn add-btn" onclick="showClassAddModal()">
                                <i class="fas fa-plus"></i> 添加班级
                            </button>
                        </div>
                    </div>
                    <div class="table-container">
                        <table>
                            <thead>
                                <tr>
                                    <th>班级代号</th>
                                    <th>班级名称</th>
                                    <th>所属专业</th>
                                    <th>所属学院</th>
                                    <th>入学年份</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr v-for="clazz in classes">
                                    <td>{{ clazz.classCode }}</td>
                                    <td>{{ clazz.className }}</td>
                                    <td>{{ clazz.majorName }}</td>
                                    <td>{{ clazz.collegeName }}</td>
                                    <td>20{{ clazz.enrollmentYear }}</td>
                                    <td>
                                        <button class="action-btn edit-btn" @click="updateClass">编辑</button>
                                        <button class="action-btn delete-btn" @click="deleteClass(clazz.classCode,clazz.majorCode,clazz.collegeCode)">删除</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>

            <!-- 学院管理内容 -->
            <div id="college-content" class="content-section">

                <!-- 加载界面 -->
                <div class="loading-box" v-show="loading">
                    <div class="spinner"></div>
                    <p class="loading-text">正在加载...</p>
                </div>

                <!-- 添加学院模态框表单页面 -->
                <div class="collegeAddModal" id="collegeAddModal">
                    <div class="modal-content">
                        <button class="close-btn" onclick="closeCollegeAddModal()">&times;</button>
                        <form @submit.prevent="addCollege">
                            <h2 class="modal-title">添加学院信息</h2>
                            <label for="collegeCode-college">学院代码</label>
                            <input type="text" id="collegeCode-college" v-model="formData.collegeCode">
                            <label for="collegeName-college">学院名称</label>
                            <input type="text" id="collegeName-college" v-model="formData.collegeName">
                            <button type="submit">添加学院</button>
                        </form>
                    </div>
                </div>


                <h1 class="page-title">学院管理</h1>
                <div class="management-content active">
                    <div class="management-header">
                        <h2>学院列表</h2>
                        <div class="opt-btn-group">
                            <button class="opt-btn refresh-btn" @click="loadColleges">
                                <i class="fas fa-refresh"></i> 刷新
                            </button>
                            <button class="opt-btn add-btn" onclick="showCollegeAddModal()">
                                <i class="fas fa-plus"></i> 添加学院
                            </button>
                        </div>
                    </div>
                    <div class="table-container">
                        <table>
                            <thead>
                                <tr>
                                    <th>学院代号</th>
                                    <th>学院名称</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr v-for="college in colleges">
                                    <td> {{college.collegeCode}} </td>
                                    <td> {{college.collegeName}} </td>
                                    <td>
                                        <button class="action-btn edit-btn" @click="updateCollege">编辑</button>
                                        <button class="action-btn delete-btn" @click="deleteCollege(college.collegeCode)">删除</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>

            <!-- 专业管理内容 -->
            <div id="major-content" class="content-section">

                <!-- 加载界面 -->
                <div class="loading-box" v-show="loading">
                    <div class="spinner"></div>
                    <p class="loading-text">正在加载...</p>
                </div>

                <!-- 添加专业模态框表单页面 -->
                <div class="majorAddModal" id="majorAddModal">
                    <div class="modal-content">
                        <button class="close-btn" onclick="closeMajorAddModal()">&times;</button>
                        <form @submit.prevent="addMajor">
                            <h2 class="modal-title">添加专业信息</h2>
                            <label for="majorCode-major">专业代码</label>
                            <input type="text" id="majorCode-major" v-model="formData.majorCode" required>
                            <label for="majorName-major">专业名称</label>
                            <input type="text" id="majorName-major" v-model="formData.majorName" required>
                            <label for="collegeCode-major">所属学院</label>
                            <select id="collegeCode-major" class="college-select" v-model="formData.collegeCode" required>
                                <option value="">请选择学院</option>
                                <option v-for="college in colleges" :value="college.collegeCode">
                                    {{ college.collegeName }}
                                </option>
                            </select>
                            <button type="submit">添加专业</button>
                        </form>
                    </div>
                </div>


                <h1 class="page-title">专业管理</h1>
                <div class="management-content active">
                    <div class="management-header">
                        <h2>专业列表</h2>
                        <div class="opt-btn-group">
                            <button class="opt-btn refresh-btn" @click="loadMajors">
                                <i class="fas fa-refresh"></i> 刷新
                            </button>
                            <button class="opt-btn add-btn" onclick="showMajorAddModal()">
                                <i class="fas fa-plus"></i> 添加专业
                            </button>
                        </div>
                    </div>
                    <div class="table-container">
                        <table>
                            <thead>
                                <tr>
                                    <th>专业代号</th>
                                    <th>专业名称</th>
                                    <th>所属学院代码</th>
                                    <th>所属学院名称</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr v-for="major in majors">
                                    <td> {{ major.majorCode }} </td>
                                    <td> {{ major.majorName }} </td>
                                    <td> {{ major.collegeCode }} </td>
                                    <td> {{ major.collegeName }} </td>
                                    <td>
                                        <button class="action-btn edit-btn" @click="updateMajor">编辑</button>
                                        <button class="action-btn delete-btn" @click="deleteMajor(major.majorCode)">删除</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>

            <!-- 课程安排内容 -->
            <div id="schedule-content" class="content-section">

                <!-- 加载界面 -->
                <div class="loading-box" v-show="loading">
                    <div class="spinner"></div>
                    <p class="loading-text">正在加载...</p>
                </div>

                <!-- 添加学院模态框表单页面 -->
                <div class="scheduleAddModal" id="scheduleAddModal">
                    <div class="modal-content">
                        <button class="close-btn" onclick="closeScheduleAddModal()">&times;</button>
                        <form @submit.prevent="addSchedule">
                            <h2 class="modal-title">添加课程安排信息</h2>
                            <label for="teacherCode-schedule">授课老师</label>
                            <select id="teacherCode-schedule" class="teacher-select" v-model="formData.teacherUserNo" required>
                                <option value="">请选择教师</option>
                                <option v-for="teacher in teachers" :value="teacher.userNo">
                                    {{ teacher.name }}
                                </option>
                            </select>
                            <label for="courseId-schedule">课程</label>
                            <select id="courseId-schedule" class="course-select" v-model="formData.courseId" required>
                                <option value="">请选择课程</option>
                                <option v-for="course in courses" :value="course.courseId">
                                    {{ course.courseName }}
                                </option>
                            </select>
                            <label for="semester-schedule">学期</label>
                            <!-- 按常理来说这里不应该静态写死的，但此处图方便不添加后端获取学期数据了 -->
                            <select id="semester-schedule" class="semester-select" v-model="formData.semester" required>
                                <option value="">请选择学期</option>
                                <option value="2022-2023-1">2022-2023-1</option>
                                <option value="2022-2023-2">2022-2023-2</option>
                                <option value="2023-2024-1">2023-2024-1</option>
                                <option value="2023-2024-2">2023-2024-2</option>
                                <option value="2024-2025-1">2024-2025-1</option>
                                <option value="2024-2025-2">2024-2025-2</option>
                                <option value="2025-2026-1">2025-2026-1</option>
                                <option value="2025-2026-2">2025-2026-2</option>
                                <option value="2026-2027-1">2026-2027-1</option>
                            </select>
                            <label for="class-schedule">上课班级</label>
                            <select id="class-schedule" class="class-select" v-model="this.formDataClass" required>
                                <option value="">请选择班级</option>
                                <option v-for="clazz in classes" :value="clazz.classCode + '-' + clazz.majorCode + '-' + clazz.collegeCode">
                                    {{ clazz.className }}
                                </option>
                            </select>
                            <button type="submit">添加课程安排</button>
                        </form>
                    </div>
                </div>

                <h1 class="page-title">课程安排</h1>
                <div class="management-content active">
                    <div class="management-header">
                        <h2>课程安排列表</h2>
                        <div class="opt-btn-group">
                            <button class="opt-btn refresh-btn" @click="loadSchedules">
                                <i class="fas fa-refresh"></i> 刷新
                            </button>
                            <button class="opt-btn add-btn" onclick="showScheduleAddModal()">
                                <i class="fas fa-plus"></i> 添加课程安排
                            </button>
                        </div>
                    </div>
                    <div class="table-container">
                        <table>
                            <thead>
                                <tr>
                                    <th>教师工号</th>
                                    <th>教师名称</th>
                                    <th>课程代码</th>
                                    <th>课程名称</th>
                                    <th>学分</th>
                                    <th>学期</th>
                                    <th>上课班级名称</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr v-for="schedule in schedules">
                                    <td>{{ schedule.teacherUserNo }}</td>
                                    <td>{{ schedule.teacherName }}</td>
                                    <td>{{ schedule.courseCode }}</td>
                                    <td>{{ schedule.courseName }}</td>
                                    <td>{{ schedule.credit }}</td>
                                    <td>{{ schedule.semester }}</td>
                                    <td>{{ schedule.className }}</td>
                                    <td>
                                        <button class="action-btn edit-btn" @click="updateSchedule">编辑</button>
                                        <button class="action-btn delete-btn" @click="deleteSchedule(schedule.scheduleId)">删除</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>

        <!-- 底部 -->
        <div class="footer">
            <p>&copy; <%= java.time.LocalDate.now().getYear() %> 学生成绩管理系统. All rights reserved.</p>
        </div>
    </div>
</div>

<!--引入vue-->
<script src="${pageContext.request.contextPath}/js/vue.js"></script>
<script src="${pageContext.request.contextPath}/page/admin/js/main.js"></script>
<script>
    // 创建Vue实例
    const {createApp} = Vue
    // 定义全局变量contextPath
    window.contextPath = "${pageContext.request.contextPath}"
</script>
<script src="${pageContext.request.contextPath}/page/admin/js/student.js"></script>
<script src="${pageContext.request.contextPath}/page/admin/js/teacher.js"></script>
<script src="${pageContext.request.contextPath}/page/admin/js/college.js"></script>
<script src="${pageContext.request.contextPath}/page/admin/js/major.js"></script>
<script src="${pageContext.request.contextPath}/page/admin/js/class.js"></script>
<script src="${pageContext.request.contextPath}/page/admin/js/course.js"></script>
<script src="${pageContext.request.contextPath}/page/admin/js/schedule.js"></script>

</body>
</html>
